/*
 * Dialogs.java
 *
 *  created: 14.11.2011
 *  charset: UTF-8
 *  license: MIT (X11) (See LICENSE file for full license)
 */
package cz.mp.k3bg.gui;

import java.awt.Component;
import javax.swing.JOptionPane;
import static cz.mp.k3bg.TextSource.*;

/**
 * Zobrazuje varovné, chybové, informační dialogy.
 * 
 * @author Martin Pokorný
 * @version 0.1
 */
public class Dialogs {

    /** */
    private Dialogs() {        
    }

    /**
     * 
     * @param parent
     * @param message 
     */
    public static void showErrorDialog(Component parent, String message) {
        JOptionPane.showMessageDialog(
                parent, 
                message, 
                getLocText("err.general"),
                JOptionPane.ERROR_MESSAGE);        
    }
    
    /**
     * 
     * @param message 
     */
    public static void showErrorDialog(String message) {
        showErrorDialog(MainFrame.getInstance(), message);
    }
    
    /**
     * 
     * @param message 
     */
    public static void showErrorDialog(Exception ex) {
        showErrorDialog(MainFrame.getInstance(), ex.toString());
    }    
        
}   // Dialogs.java

